/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.jsysacc.asistencia.model.logic.maestros;

import com.jsysacc.asistencia.model.beans.maestros.Area;
import com.jsysacc.asistencia.model.beans.maestros.Cargo;
import com.jsysacc.asistencia.model.beans.maestros.Horario;
import com.jsysacc.asistencia.model.beans.maestros.Personal;
import com.jsysacc.asistencia.model.beans.maestros.TipoDocumento;
import com.jsysacc.asistencia.model.beans.maestros.Ubigeo;
import com.jsysacc.asistencia.model.beans.maestros.Via;
import com.jsysacc.asistencia.model.beans.maestros.Zona;
import com.jsysacc.asistencia.model.dao.design.maestros.IAreaDAO;
import com.jsysacc.asistencia.model.dao.design.maestros.ICargoDAO;
import com.jsysacc.asistencia.model.dao.design.maestros.IHorarioDAO;
import com.jsysacc.asistencia.model.dao.design.maestros.IPersonalDAO;
import com.jsysacc.asistencia.model.dao.design.maestros.ITipoDocumentoDAO;
import com.jsysacc.asistencia.model.dao.design.maestros.IUbigeoDAO;
import com.jsysacc.asistencia.model.dao.design.maestros.IViaDAO;
import com.jsysacc.asistencia.model.dao.design.maestros.IZonaDAO;
import com.jsysacc.asistencia.model.dao.factory.MainDAOFactory;
import java.util.ArrayList;

/**
 *
 * @author Carlos
 */
public class PersonalLogic {

    IAreaDAO areaDAO = MainDAOFactory.getInstance().getAreaDAO();
    IHorarioDAO horarioDAO = MainDAOFactory.getInstance().getHorarioDAO();
    ICargoDAO cargoDAO = MainDAOFactory.getInstance().getCargoDAO();
    IViaDAO viaDAO = MainDAOFactory.getInstance().getViaDAO();
    IZonaDAO zonaDAO = MainDAOFactory.getInstance().getZonaDAO();
    ITipoDocumentoDAO tipoDocumentoDAO = MainDAOFactory.getInstance().getTipoDocumentoDAO();
    IUbigeoDAO ubigeoDAO = MainDAOFactory.getInstance().getUbigeoDAO();
    IPersonalDAO personalDAO = MainDAOFactory.getInstance().getPersonalDAO();

    public PersonalLogic() {
    }

    public ArrayList<Area> getAreasAll() throws Exception {
        return areaDAO.getAll();
    }

    public ArrayList<Horario> getHorariosAll() throws Exception {
        return horarioDAO.getAll();
    }

    public ArrayList<Cargo> getCargosAll() throws Exception {
        return cargoDAO.getAll();
    }

    public ArrayList<Via> getViasAll() throws Exception {
        return viaDAO.getAll();
    }

    public ArrayList<Zona> getZonasAll() throws Exception {
        return zonaDAO.getAll();
    }
    public Area getAreasByPk(String cod_are) throws Exception {
        return areaDAO.getByPk(cod_are);
    }

    public Horario getHorariosByPk(String cod_hor) throws Exception {
        return horarioDAO.getByPk(cod_hor);
    }

    public Cargo getCargosByPk(String cod_car) throws Exception {
        return cargoDAO.getByPk(cod_car);
    }

    public Via getViasByPk(String cod_via) throws Exception {
        return viaDAO.getByPk(cod_via);
    }

    public Zona getZonasByPk(String cod_zon) throws Exception {
        return zonaDAO.getByPk(cod_zon);
    }

    public ArrayList<TipoDocumento> getTipoDocumentosAll() throws Exception {
        return tipoDocumentoDAO.getAll();
    }
    public TipoDocumento getTipoDocumentoByPk(String pk) throws Exception {
        return tipoDocumentoDAO.getByPk(pk);
    }

    public ArrayList<Ubigeo> getDepartamentosAll(String cod_dep) throws Exception {
        return ubigeoDAO.getDepartamentosAll(cod_dep);
    }

    public ArrayList<Ubigeo> getProvinciasByCodDep(String cod_dep) throws Exception {
        return ubigeoDAO.getProvinciasByCodDep(cod_dep);
    }

    public ArrayList<Ubigeo> getDistritosByCodProv(String cod_dep, String cod_prov) throws Exception {
        return ubigeoDAO.getDistritosByCodProv(cod_dep, cod_prov);
    }

    public Ubigeo getByPk(int pk) throws Exception {
        return ubigeoDAO.getByPk(pk);
    }
    public Ubigeo getUbigeo(String cod_dep, String cod_prov, String cod_dist) throws Exception {
        return ubigeoDAO.getUbigeo(cod_dep, cod_prov, cod_dist);
    }

    public ArrayList<Personal> getAll() throws Exception {
        return personalDAO.getAll();
    }

    public ArrayList<Personal> getByCriterio(String criterio, String valor) throws Exception {
        return personalDAO.getByCriterio(criterio, valor);
    }

    public Personal getByPk(String pk) throws Exception {
        return personalDAO.getByPk(pk);
    }

    public boolean delete(String pk) throws Exception {
        return personalDAO.delete(pk);
    }

    public boolean insert(Personal entity) throws Exception {
        return personalDAO.insert(entity);
    }

    public boolean update(Personal entity) throws Exception {
        return personalDAO.update(entity);
    }
}
